package com.alipay.app.groupmeal.standard.ui.c.pre;

import android.view.Display;
import android.view.KeyEvent;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.alipay.app.groupmeal.standard.R;
import com.alipay.app.groupmeal.standard.base.BasePresentation;
import com.alipay.app.groupmeal.standard.ui.c.CUnpaidActivity;

/**
 * @ProjectName: 团餐
 * @ClassName: UnpaidPre
 * @Description: java类作用描述
 * @Author: bd-001935
 * @CreateDate: 6/23/22 11:16 AM
 * @UpdateUser: bd-001935
 * @UpdateDate: 6/23/22 11:16 AM
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class UnpaidPre extends BasePresentation {

    private TextView mTvAmount;
    private ImageView mIvQrcode;
    private TextView mTvNotPaidNum;
    private TextView mTvTips;
    private TextView mBtnPaid;
    private LinearLayout mLlCancel;
    private TextView mTvCloseTime;
    private CUnpaidActivity mActivity;

    public UnpaidPre(CUnpaidActivity outerContext, Display display) {
        super(outerContext, display);
        mActivity = outerContext;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_unpaid;
    }

    @Override
    protected void initView() {
        mTvAmount = findViewById(R.id.tv_amount);
        mIvQrcode = findViewById(R.id.iv_qrcode);
        mTvNotPaidNum = findViewById(R.id.tv_not_paid_num);
        mTvTips = findViewById(R.id.tv_tips);
        mBtnPaid = findViewById(R.id.btn_paid);
        mLlCancel = findViewById(R.id.ll_cancel);
        mTvCloseTime = findViewById(R.id.tv_close_time);
    }

    @Override
    protected void initData() {
    }

    public TextView getTvAmount() {
        return mTvAmount;
    }

    public ImageView getIvQrcode() {
        return mIvQrcode;
    }

    public TextView getTvNotPaidNum() {
        return mTvNotPaidNum;
    }

    public TextView getTvTips() {
        return mTvTips;
    }

    public TextView getBtnPaid() {
        return mBtnPaid;
    }

    public LinearLayout getLlCancel() {
        return mLlCancel;
    }

    public TextView getTvCloseTime() {
        return mTvCloseTime;
    }

    @Override
    public boolean onKeyEventBack(KeyEvent event) {
        //CUnpaidActivity无法拿到小键盘返回键的点击事件,需要特殊处理
        if (mActivity != null)
            mActivity.payResult(false);
        return false;
    }

}
